<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <script>
        // 100,10
        let arr = [10,20,30,40]
        // console.log(arr);
        // console.log(arr[0],arr[1],arr[2],arr[3]);
        // 扩展运算符
        // 用于方法中，传递多个参数
        console.log(...arr);
        console.log(10,20,30);
        console.log(Math.max(10,20,30,40));
        console.log(Math.max(...arr));


        // 浅拷贝
        let arr2 = [...arr]
        arr[0] = 100
        // let arr2 = arr
        // arr[100]
        console.log(arr);
        console.log(arr2);
        // let arr2 = [10,20,30,40]

        let xin = []
        for (let i = 0; i < arr.length; i++) {
            xin.push(arr[i])            
        }
        console.log(xin);
        xin[0]=1000
        console.log(arr);
    </script>
</body>
</html>